package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


import model.College;
import model.Teacher;
import model.Users;
import types.ConsoleType;
import view.Main_Frame;
import view.PanelUserList;
import dataLayer.DBconnect;

public class Refresh extends DBconnect implements ActionListener {
	public void actionPerformed(ActionEvent e) {
		openConn();
		if (e.getActionCommand().equals("refresh")){
			String message = null;
			ConsoleType type = null;
			
			
//			College.getInstance().setAllactiveTeachers();
//			College.getInstance().setAllGroups();
//			College.getInstance().setAllAbsences();
//			Users.getInstance().setAllUsers();
//			
//			
//			Teacher.getInstance().setTodayabsenceList();
//			Teacher.getInstance().setWeekabsenceList();
			
			PanelUserList.getInstance().repaint();
			PanelUserList.getInstance().validate();
			Main_Frame.refresh();
			Main_Frame.getInstance().validate();

			message = "Alle inhoud is vernieuwd.";
			type = ConsoleType.REFRESH;
			Console.getInstance().setConsole(message, type);
		}
	}
}
